#include "StdAfx.h"
#include "AxOleControlModule.h"


#include "afxcontrolbarutil.h"

#ifndef _AFX_NO_OCX_SUPPORT


#define new DEBUG_NEW


/////////////////////////////////////////////////////////////////////////////
// COleControlModule::InitInstance

IMPLEMENT_DYNAMIC(CAxOleControlModule, CWinAppEx)

BOOL CAxOleControlModule::InitInstance()
{
#ifdef _AFXDLL
	// wire up resources from OLE DLL
	AfxOleInitModule();
#endif

	// Since we don't call CWinApp::InitInstance here, but do call CWinApp::ExitInstance
	// from COleControlModule::ExitInstance, we need to call AfxGlobalsAddRef in order to
	// keep the reference count on the afxGlobalData object consistent (when using MFC DLL).
#ifdef _AFXDLL
	AfxGlobalsAddRef();
#endif

	COleObjectFactory::RegisterAll();
	return CWinAppEx::InitInstance();
	//return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// COleControlModule::ExitInstance

int CAxOleControlModule::ExitInstance()
{
	COleObjectFactory::RevokeAll();
	return CWinAppEx::ExitInstance();
}

#endif // !_AFX_NO_OCX_SUPPORT
